package com.bmps.springcloud.insuredmicroservice.service.accept;

import com.bmps.springcloud.insuredmicroservice.model.accept.PersonModel;
import com.bmps.springcloud.insuredmicroservice.repository.accept.coresystem.InsuranceAcceptCoreRepository;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;

/**
 * @author lyw
 * @date 2019/9/3 10:56
 */
@Service
public class InsuranceAcceptCoreServiceImpl implements InsuranceAcceptCoreService {

    private final InsuranceAcceptCoreRepository insuranceAcceptCoreRepository;

    public InsuranceAcceptCoreServiceImpl(InsuranceAcceptCoreRepository insuranceAcceptCoreRepository) {
        this.insuranceAcceptCoreRepository = insuranceAcceptCoreRepository;
    }

    /**
     * 根据人员列表的五要素获取对应人员的客户号以及理赔和黑名单标识
     *
     * @param personModelList 人员列表
     * @return List<PersonModel>
     */
    @Override
    public List<PersonModel> getPersonCustomerNoList(HashSet<PersonModel> personModelList) {
        return insuranceAcceptCoreRepository.getPersonCustomerNoList(personModelList);
    }

    /**
     * 根据姓名查询是否是黑名单
     *
     * @param name 姓名
     * @return List<PersonModel>
     */
    @Override
    public List<PersonModel> queryBlackByName(String name) {
        return insuranceAcceptCoreRepository.queryBlackByName(name);
    }

    @Override
    public String getHistoryVerificationContno(String customerNo) {
        return insuranceAcceptCoreRepository.getHistoryVerificationContno(customerNo);
    }

    @Override
    public String queryRiskAndInsurance(String customerNo) {
        return insuranceAcceptCoreRepository.queryRiskAndInsurance(customerNo);
    }

    @Override
    public String queryAgentCom(String agentCom) {
        return insuranceAcceptCoreRepository.queryAgentCom(agentCom);
    }

    @Override
    public int getSpecialAnnal(String prtNo, String customerNo) {
        return insuranceAcceptCoreRepository.getSpecialAnnal(prtNo, customerNo);
    }

    @Override
    public Integer getMobilePhoneUseTimes(String phone) {
        return insuranceAcceptCoreRepository.queryMobilePhoneUseTimes(phone);
    }
}
